Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement the --sync flag for df. (fixes #3564) #3592

Merged
merged 2 commits into from
Jun 6, 2022
Merged

Implement the --sync flag for df. (fixes #3564) #3592

merged 2 commits into from
Jun 6, 2022

Conversation

anastygnome
Copy link
Contributor

This PR reuses the defined --sync flag for df, which was previously a
no-op, assigns its default value and uses the fact that
get_all_filesystems takes CLI options as a parameter to perform a sync
operation before any fs call.

Fixes #3564

Signed-off-by: anastygnome [email protected]

@sylvestre
Copy link
Contributor

please add a test. As it is probably too hard to verify that the sync is actually preformed, it will just check that we have a test using the code path
thanks

@anastygnome
Copy link
Contributor Author

@sylvestre your wish is my command ;)

@sylvestre
Copy link
Contributor

ah ah, thanks for not being nasty ;)

@anastygnome
Copy link
Contributor Author

anastygnome commented Jun 4, 2022

ah ah, thanks for not being nasty ;)

there's an issue with dependencies

Can you look into it ? I don't know why uucore isn't importing sync from libc.

@tertsdiepraam
Copy link
Member

I don't know why uucore isn't import sync from libc.

The failing builds are on Windows, where sync does not exist :)

@anastygnome
Copy link
Contributor Author

anastygnome commented Jun 5, 2022

thank you @tertsdiepraam, I'm not a windows dev at all ;)

I reused some code from uu_sync to encompass all cases.

Is there an available API or function in the uucore librairies to do so ?

This PR reuses the defined --sync flag for df, which was previously a
no-op, assigns its default value and uses the fact that
get_all_filesystems takes CLI options as a parameter to perform a sync
operation before any fs call.

Fixes #3564

Signed-off-by: anastygnome <[email protected]>
It is probably too hard to verify that the sync is actually performed,
so we just check that we have a test using the code path, pro forma.

Signed-off-by: anastygnome <[email protected]>
@sylvestre sylvestre merged commit 63347ab into uutils:main Jun 6, 2022
@anastygnome anastygnome deleted the fork branch June 6, 2022 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

df: --sync is not implemented
3 participants